#pragma once

#include <algorithm/analytical_model/algorithm/cuda/inter_op/Data.h>
#include <algorithm/analytical_model/algorithm/cuda/inter_op/receiver/Receiver.h>

#include <tuple>

namespace solar::cuda
{
    class ImagePlane;
}

namespace solar::cuda::inter_op
{
    class ImagePlane : public Receiver
    {
        public:
            ImagePlane(cudaStream_t stream = nullptr);
            /// @returns {t, u, v, isIntersected}
            [[nodiscard]] auto intersect(const Float3& orig, const Float3& dir) const
                -> std::tuple<float, float, float, bool>;
            void init(float pixel_per_meter_for_receiver) const override;
            void setResolution(float pixel_per_meter_for_receiver) const override;
            [[nodiscard]] auto getFocusCenter(const Float3& heliostat_position) const
                -> Float3 override;
            void setAxis(const Float3& x, const Float3& y) const;
            [[nodiscard]] auto getVertices() const -> std::array<Float3, 4>;
            void setVertices(const std::array<Float3, 4>& vertices);

            virtual ~ImagePlane() = default;
    };
} // namespace solar::cuda::inter_op
